@extends('adminer.admin')
@section("style")

@endsection
@section('content')
    <!-- BEGIN PAGE HEADER-->
    @include("adminer.public.bread")
    <!-- END PAGE HEADER-->
    <!-- BEGIN PAGE CONTENT-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN VALIDATION STATES-->
            <div class="widget box blue">
                <div class="widget-title">
                    <h4><i class="icon-reorder"></i>{{$title}}</h4>
                    <span class="tools">
                           <a href="javascript:;" class="icon-chevron-down"></a>
                           <a href="javascript:;" class="icon-remove"></a>
                        </span>
                </div>
                <div class="widget-body form">
                    <div class="alert alert-error" id="error" style="display: none">
                        <button class="close" data-dismiss="alert">×</button>
                        <strong id="error-tip">Error!</strong>
                    </div>
                    <!-- BEGIN FORM-->
                    <form action="{{route("purview.update",$info->id)}}" method="post" id="main-form" class="form-horizontal">
                        @method('PUT')
                        <div class="control-group">
                            <label class="control-label">上级权限</label>
                            <div class="controls">
                                <select class="span3 chosen" name="parent" data-placeholder="Choose a Category" tabindex="1">
                                    <?=$curr_html?>
                                    <option value="0">顶级权限</option>
                                    <?=$opt_html?>
                                </select>
                                <span class="help-inline">上级权限，默认为顶级权限</span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">权限图标</label>
                            <div class="controls input-icon">
                                <input type="text" class="span2" name="icon" value="{{$info->icon}}" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">权限名称</label>
                            <div class="controls input-icon">
                                <input type="text" class="span3" name="title" value="{{$info->title}}" />

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">权限ID</label>
                            <div class="controls input-icon">
                                <input type="text" class="span3" name="pid" value="{{$info->pid}}" />

                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">载入框架</label>
                            <div class="controls">
                                <label class="checkbox">
                                    <input type="checkbox" value="1" name="f_main" @if($info->f_main ==1) checked @endif /> 核心框架
                                    <span class="help-inline">只有选择后，才会在相应框架下载入该权限</span>
                                </label>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">状态</label>
                            <div class="controls">
                                <label class="radio">
                                    <input type="radio" name="status" value="1" @if($info->status ==1) checked @endif />
                                    正常
                                </label>
                                <label class="radio">
                                    <input type="radio" name="status" value="0" @if($info->status ==0) checked @endif />
                                    屏蔽
                                </label>
                                <span class="help-inline">正常则能显示可使用</span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">URL地址</label>
                            <div class="controls input-icon">
                                <input type="text" class="span3" name="url" value="{{$info->url}}" />
                                <span class="help-inline"> 本系统URL,无须填写完整地址,例：purivew. 外部地址必须填写完整地址,例：http://www.baidu.com</span>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">功能</label>
                            <div class="controls input-icon">
                                <input type="text" class="span4" name="func" value="{{$info->func}}" />
                                <span class="help-inline">功能名称，例：add、edit、del 、listorder...，以逗号（“,”）分隔，这里只填写，需要分配的功能</span>
                            </div>
                        </div>

                        <div class="form-actions">
                            <button type="submit" class="btn btn-success">保存</button>
                            <button type="button" class="btn" onclick="javascript:window.history.back();">放弃</button>
                        </div>
                    </form>
                    <!-- END FORM-->
                </div>
            </div>
            <!-- END VALIDATION STATES-->
        </div>
    </div>
    <!-- END PAGE CONTENT-->
@endsection
@section("script")
    <script>
        jQuery(document).ready(function() {
            // initiate layout and plugins
            App.init();
        });
    </script>
@endsection